package com.googlecode.imule.redundant;

/**
 * Simple television class to simulate television object
 * and perhaps some RDF features?
 * @author Mike
 */

public class Television {

	public Television(String n, String t){
		super();
		name = n;
		type = t;
	}
	
	/**
	 * Name of instance of device
	 */
	private String name;
	private String type;
	private Boolean state = true;
	
	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	
	/*
	 * Television
	 */
	private int volume;
	private int channel;
	
	/**
	 * @return the volume
	 */
	public int getVolume() throws Exception{
		return volume;
	}

	/**
	 * Set the volume of the TV (or possibility)
	 * @param Devices
	 */
	public void setVolume(int volume) {
		this.volume = volume;
	}
	
	public void incVolume(){
		while(this.volume <= 100){
			this.volume++;
		}
	}
	
	public void decVolume(){
		while(this.volume >=0){
			this.volume--;
		}
	}

	/**
	 * Get the channel of the TV or other devices
	 * @return the channel
	 */
	public int getChannel() throws Exception {
		return channel;
	}

	/**
	 * Set the channel on the TV or other devices
	 * @param channel
	 */
	public void setChannel(int channel) {
		if((channel >= 0) && (channel <= 100)){
			this.channel = channel;
		}
	}
	
}
